package smallChanges.lineNumberMapping;

import smallChanges.statements.FieldDeclarationStatement;
import smallChanges.statements.MethodDeclarationStatement;

public class RenamedSourceObjectComparisonFactory {

    public static RenamedSourceObjectComparison getRenamedSourceObjectComparison(Object left, Object right,
    		ClassSource leftClass, ClassSource rightClass, StatementMapper sm)
    {
        RenamedSourceObjectComparison retVal = null;
        
        if( left.getClass() == right.getClass() )
        {
            

            if( left.getClass() == MethodDeclarationStatement.class)
            {
                retVal = new RenamedMethodComparison((MethodDeclarationStatement)left, (MethodDeclarationStatement)right,
                		leftClass, rightClass, sm);
            }
            else if(left.getClass() == ClassSource.class)
            {
                retVal = new RenamedClassComparison((ClassSource) left, (ClassSource) right);
            }
            else if(left.getClass() == FieldDeclarationStatement.class)
            {
                retVal = new RenamedFieldComparison((FieldDeclarationStatement)left, (FieldDeclarationStatement)right);
            }

        }
        return retVal;
    }
    

}
